# 装包
# 导包
# 实例化
# 加密时返回字符串dumps
# 解密loads
from django.conf import settings
from itsdangerous import  TimedJSONWebSignatureSerializer as Serializer
class SecretOauth(object):
    def dumps(self,data):
        s = Serializer(secret_key=settings.SECRET_KEY, expires_in=24 * 15 * 60)
        result = s.dumps(data).decode()
        return result
    def loads(self,data):
        s = Serializer(secret_key=settings.SECRET_KEY, expires_in=24 * 15 * 60)
        result = s.loads(data)
        return result


